package com.leftheart.service.impl;

import com.leftheart.entity.Books;
import com.leftheart.entity.User;
import com.leftheart.mapper.UserMapper;
import com.leftheart.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.authc.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.*;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public int addUser(@Param("userName")String userName, @Param("userPwd") String userPwd, long accounts) { return userMapper.addUser(userName,userPwd,accounts); }

    @Override
    public int deleteUserById(int userId) { return userMapper.deleteUserById(userId); }

    @Override
    public int updateUser(User user) { return userMapper.updateUser(user); }

    @Override
    public User queryUserById(int userId) { return userMapper.queryUserById(userId); }

    @Override
    public List<User> queryAllUser() { return userMapper.queryAllUser(); }

    @Override
    public User queryUserByName(String userName) { return userMapper.queryUserByName(userName); }
}
